<!-- 
			'catalogList' => $catalogList,
			'categories' => $categories,
			'categoryMaterials' => $categoryMaterialRs


-->

<body class="app" data-ad="true">

<section class="app-content">
	<section class="page page-index noline" data-plugin-type="info_front">

        <article class="source-top">
            <div class="search-top">
                <select><option>全部</option>
					<?php foreach($this->catalogList as $k=>$catalog): ?>
					<option><?php  echo $catalog['material_catalog_name'];?></option>
					<?php endforeach;?>                

                </select>
                <a class="search-link" href="<?php echo $this->url('material', array('action'=>'search'));?>">搜索</a>
            </div>
        </article>

        <div class="shop-ct-block source-ct-block mt20">
            <!-- 左边菜单-->
            <div class="sp-l-nav">
                <ul>
                    <!--li class="on"><a href="javascript:;">类目一</a></li>
                    <li><a href="#item01">类目一</a></li>
                    <li><a href="#item02">类目2</a></li>
                    <li><a href="javascript:;">类目一</a></li-->
                    <?php foreach($this->categories as $k=>$category): ?>
                    <li><a href="<?php echo "#item_{$category['material_category_id']}"; ?>"><?php echo $category['material_category_name']; ?></a></li>
                    <?php endforeach; ?>
                </ul>
            </div>
            <!-- 右边内容-->
            <div class="sp-r-ct bw">
            <?php foreach($this->categoryMaterials as $k=>$categoryMaterial): ?>
            	<div id="<?php echo "item_{$categoryMaterial['data']['material_category_id']}" ?>" class="sp-item">
                    <span class="itm-title btn-yel"><?php echo $categoryMaterial['data']['material_category_name'] ?></span>
                    <ul class="source-list">
                    	<?php foreach($categoryMaterial['materials'] as $k=>$material): ?>
                    	<li><a class="btn-source" href="<?php echo $this->url('material', array('action'=>'detail','material_id'=>$material['material_id']));?>">溯 源</a><span class="mr20"><?php echo $material['material_code']; ?></span><span><?php echo $material['material_name']; ?></span></li>
                    	<?php endforeach; ?> 
                    </ul>
                 </div>
            <?php endforeach;?>
            
            
                <!--  div id="item01" class="sp-item">
                    <span class="itm-title btn-yel">类目A</span>
                    <ul class="source-list">
                        <li><a class="btn-source" href="<?php echo $this->url('material', array('action'=>'detail'));?>">溯 源</a><span class="mr20">001001</span><span>XXXXXX</span></li>
                        <li><a class="btn-source" href="<?php echo $this->url('material', array('action'=>'detail'));?>">溯 源</a><span class="mr20">001001</span><span>XXXXXX</span></li>
                        <li><a class="btn-source" href="<?php echo $this->url('material', array('action'=>'detail'));?>">溯 源</a><span class="mr20">001001</span><span>XXXXXX</span></li>
                    </ul>

                </div>

                <div id="item02" class="sp-item">
                    <span class="itm-title btn-yel">类目B</span>
                    <ul class="source-list">
                        <li><a class="btn-source" href="<?php echo $this->url('material', array('action'=>'detail'));?>">溯 源</a><span class="mr20">001001</span><span>XXXXXX</span></li>
                        <li><a class="btn-source" href="<?php echo $this->url('material', array('action'=>'detail'));?>">溯 源</a><span class="mr20">001001</span><span>XXXXXX</span></li>
                        <li><a class="btn-source" href="<?php echo $this->url('material', array('action'=>'detail'));?>">溯 源</a><span class="mr20">001001</span><span>XXXXXX</span></li>
                    </ul>

                </div-->
            </div>
        </div>

	</section>

    <!-- 底部menu-->
    <?php echo $this->partial('public/menu.phtml'); ?>
</section>
<script type="text/javascript">
$(function () {
    var myH = document.body.clientHeight-485;//去掉头部及页面底部固定内容
    //console.log(myH);
    $('.shop-ct-block,.sp-l-nav,.sp-r-ct').height(myH);
    $('.sp-r-ct .sp-btn-origin').click(function(){console.log(111)
        $('.bgMask,.popup-shop').show();
    })

    $('.bgMask').click(function(){
        $('.bgMask,.popup-shop').hide();
    })

    $('.sp-l-nav li:first').addClass("on");
    $('.sp-l-nav li').click(function(){
    	$('.sp-l-nav li').removeClass("on");
		$(this).addClass("on");

     });
});
</script>
